package com.example.boot.thread.demo.threaddemo.SynchronizedTest;


/**
 * 消失的请求
 * */
public class ThreadTest implements  Runnable{
    static ThreadTest test = new ThreadTest();
    static int a= 0;
    public static void main(String[] args) {
        Thread t1 = new Thread(test);
        Thread t2 = new Thread(test);
        t1.start();
        t2.start();
        while (t1.isAlive() || t2.isAlive()){

        }
        System.out.println(a);
    }

    @Override
    public void run() {
        synchronized (test){
            for (int j=0;j<100000;j++){
                a++;
            }
        }

    }
}
